package br.siseventos.model;
// Generated 29/10/2012 23:23:36 by Hibernate Tools 3.2.1.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * TbInscricao generated by hbm2java
 */
@Entity
@Table(name = "tb_inscricao", catalog = "SisEventosDB", uniqueConstraints =
@UniqueConstraint(columnNames = {"cod_usuario", "cod_evento"}))
public class TbInscricao extends BaseModel {

    private Integer idtInscricao;
    private TbEvento tbEvento;
    private TbUsuario tbUsuario;
    private TdPapel tdPapel;
    private char stsAvaliacaoInscricao;
    private String obsAvaliacaoInscricao;
    private Set<TaAvaliacao> taAvaliacaos = new HashSet<TaAvaliacao>(0);
    private Set<TaParticipacao> taParticipacaos = new HashSet<TaParticipacao>(0);

    public TbInscricao() {
    }

    public TbInscricao(TbEvento tbEvento, TbUsuario tbUsuario, TdPapel tdPapel, char stsAvaliacaoInscricao) {
        this.tbEvento = tbEvento;
        this.tbUsuario = tbUsuario;
        this.tdPapel = tdPapel;
        this.stsAvaliacaoInscricao = stsAvaliacaoInscricao;
    }

    public TbInscricao(TbEvento tbEvento, TbUsuario tbUsuario, TdPapel tdPapel, char stsAvaliacaoInscricao, String obsAvaliacaoInscricao, Set<TaAvaliacao> taAvaliacaos, Set<TaParticipacao> taParticipacaos) {
        this.tbEvento = tbEvento;
        this.tbUsuario = tbUsuario;
        this.tdPapel = tdPapel;
        this.stsAvaliacaoInscricao = stsAvaliacaoInscricao;
        this.obsAvaliacaoInscricao = obsAvaliacaoInscricao;
        this.taAvaliacaos = taAvaliacaos;
        this.taParticipacaos = taParticipacaos;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "idt_inscricao", unique = true, nullable = false)
    public Integer getIdtInscricao() {
        return this.idtInscricao;
    }

    public void setIdtInscricao(Integer idtInscricao) {
        this.idtInscricao = idtInscricao;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "cod_evento", nullable = false)
    public TbEvento getTbEvento() {
        return this.tbEvento;
    }

    public void setTbEvento(TbEvento tbEvento) {
        this.tbEvento = tbEvento;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "cod_usuario", nullable = false)
    public TbUsuario getTbUsuario() {
        return this.tbUsuario;
    }

    public void setTbUsuario(TbUsuario tbUsuario) {
        this.tbUsuario = tbUsuario;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "cod_papel", nullable = false)
    public TdPapel getTdPapel() {
        return this.tdPapel;
    }

    public void setTdPapel(TdPapel tdPapel) {
        this.tdPapel = tdPapel;
    }

    @Column(name = "sts_avaliacao_inscricao", nullable = false, length = 1)
    public char getStsAvaliacaoInscricao() {
        return this.stsAvaliacaoInscricao;
    }

    public void setStsAvaliacaoInscricao(char stsAvaliacaoInscricao) {
        this.stsAvaliacaoInscricao = stsAvaliacaoInscricao;
    }

    @Column(name = "obs_avaliacao_inscricao", length = 512)
    public String getObsAvaliacaoInscricao() {
        return this.obsAvaliacaoInscricao;
    }

    public void setObsAvaliacaoInscricao(String obsAvaliacaoInscricao) {
        this.obsAvaliacaoInscricao = obsAvaliacaoInscricao;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbInscricao")
    public Set<TaAvaliacao> getTaAvaliacaos() {
        return this.taAvaliacaos;
    }

    public void setTaAvaliacaos(Set<TaAvaliacao> taAvaliacaos) {
        this.taAvaliacaos = taAvaliacaos;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbInscricao")
    public Set<TaParticipacao> getTaParticipacaos() {
        return this.taParticipacaos;
    }

    public void setTaParticipacaos(Set<TaParticipacao> taParticipacaos) {
        this.taParticipacaos = taParticipacaos;
    }
}
